package com.miao.api;

import com.miao.base.model.PageResult;
import com.miao.base.model.RestResponse;
import com.miao.dto.MyCourseTableParams;
import com.miao.po.XcCourseTables;
import com.miao.service.LearningService;
import com.miao.service.XcCourseTablesService;
import com.miao.util.SecurityUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mr.M
 * @version 1.0
 * @description 我的学习接口
 * @date 2022/10/27 8:59
 */

@Slf4j
@RestController
public class MyLearningController {
    @Autowired
    private LearningService learningService;


    //用户获取视频
    @GetMapping("/open/learn/getvideo/{courseId}/{teachplanId}/{mediaId}")
    public RestResponse<String> getvideo(@PathVariable("courseId") Long courseId, @PathVariable("courseId") Long teachplanId, @PathVariable("mediaId") String mediaId) {
        //获取用户id
        SecurityUtil.XcUser user = SecurityUtil.getUser();
        String uId = user.getId();
        return learningService.getVideo(courseId, teachplanId, mediaId, uId);

    }




}
